package com.yupi.springbootinit.BiMQ.Test;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;


public class TestProducer {
    @Resource
    private RabbitTemplate rabbitTemplate;

    public void sendMessage(String exchange,String routingKey,String message) throws UnsupportedEncodingException {
        rabbitTemplate.convertAndSend(exchange,routingKey,message.getBytes("UTF-8"));
    }
}
